```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>深入解析Hashtable - 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8fafc;
            color: #1e293b;
        }
        .serif {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .highlight-box {
            border-left: 4px solid #4f46e5;
            background-color: #f5f3ff;
        }
        .drop-cap::first-letter {
            float: left;
            font-size: 3.5rem;
            line-height: 0.9;
            margin: 0.1em 0.1em 0 0;
            color: #4f46e5;
            font-family: 'Noto Serif SC', serif;
            font-weight: 700;
        }
    </style>
</head>
<body>
    <!-- Navigation -->
    <nav class="bg-white shadow-sm">
        <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16">
                <div class="flex items-center">
                    <span class="text-xl font-bold text-indigo-600 serif">技术小馆</span>
                </div>
                <div class="hidden md:flex items-center space-x-8">
                    <a href="#" class="text-gray-700 hover:text-indigo-600 transition-colors">首页</a>
                    <a href="#" class="text-gray-700 hover:text-indigo-600 transition-colors">Java</a>
                    <a href="#" class="text-gray-700 hover:text-indigo-600 transition-colors">数据结构</a>
                    <a href="#" class="text-gray-700 hover:text-indigo-600 transition-colors">关于</a>
                </div>
            </div>
        </div>
    </nav>

    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20">
        <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4 serif">深入解析 Java <span class="text-indigo-200">Hashtable</span></h1>
                    <p class="text-xl md:text-2xl text-indigo-100 mb-8">线程安全的早期哈希表实现及其现代替代方案</p>
                    <div class="flex space-x-4">
                        <div class="flex items-center">
                            <i class="fas fa-calendar-alt mr-2"></i>
                            <span>最新更新</span>
                        </div>
                        <div class="flex items-center">
                            <i class="fas fa-tags mr-2"></i>
                            <span>Java, 集合, 并发</span>
                        </div>
                    </div>
                </div>
                <div class="md:w-1/2 flex justify-center">
                    <div class="relative">
                        <div class="w-64 h-64 bg-indigo-400 rounded-full opacity-20 absolute -top-6 -left-6"></div>
                        <div class="w-64 h-64 bg-purple-400 rounded-full opacity-20 absolute -bottom-6 -right-6"></div>
                        <div class="relative bg-white p-6 rounded-lg shadow-xl w-80">
                            <div class="text-center mb-4">
                                <i class="fas fa-table text-4xl text-indigo-600"></i>
                            </div>
                            <div class="text-gray-800">
                                <h3 class="font-bold text-lg mb-2">Hashtable 概览</h3>
                                <ul class="text-sm space-y-1">
                                    <li>✓ 线程安全实现</li>
                                    <li>✓ 全表同步机制</li>
                                    <li>✗ 不允许null键值</li>
                                    <li>✓ 初始容量11</li>
                                    <li>✓ 负载因子0.75</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <div class="flex flex-col lg:flex-row gap-8">
            <!-- Article Content -->
            <article class="lg:w-2/3">
                <!-- Introduction -->
                <section class="mb-12">
                    <p class="drop-cap text-lg leading-relaxed mb-6">Hashtable 是Java早期版本中提供的哈希表实现，具有线程安全的特性。虽然它提供了对多线程环境的支持，但由于其全表同步的特性，在高并发环境下性能较差。Hashtable 不允许 null 键和值，并且在现代 Java 开发中，通常建议使用 HashMap 或 ConcurrentHashMap 替代 Hashtable。对于新开发的项目，应优先考虑更高效的集合类。</p>
                    
                    <div class="highlight-box p-6 rounded mb-8">
                        <div class="flex items-start">
                            <i class="fas fa-lightbulb text-2xl text-indigo-600 mr-4 mt-1"></i>
                            <div>
                                <h3 class="font-bold text-lg mb-2">专家建议</h3>
                                <p class="text-gray-700">在现代Java应用中，优先考虑使用<code class="bg-gray-100 px-1 rounded">ConcurrentHashMap</code>而不是<code class="bg-gray-100 px-1 rounded">Hashtable</code>，前者提供了更好的并发性能和更细粒度的锁机制。</p>
                            </div>
                        </div>
                    </div>
                </section>

                <!-- Thread Safety -->
                <section class="mb-12">
                    <h2 class="text-2xl font-bold mb-6 flex items-center serif">
                        <span class="w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center mr-4">1</span>
                        <span>线程安全</span>
                    </h2>
                    <p class="text-lg leading-relaxed mb-4">Hashtable 是线程安全的。它通过对整个表进行同步来保证线程安全，每个方法在执行时都持有对整个 Hashtable 的锁。这意味着多个线程可以安全地访问和修改 Hashtable，而不会发生数据不一致的情况。</p>
                    <p class="text-lg leading-relaxed mb-6">然而，这种全表级的锁也会导致性能瓶颈，尤其是在高并发场景下，因为只有一个线程能够对 Hashtable 进行操作，其他线程需要等待锁释放。</p>
                    
                    <div class="bg-gray-50 p-6 rounded-lg mb-4">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-code text-indigo-600 mr-2"></i>
                            <h3 class="font-mono font-bold">示例代码</h3>
                        </div>
                        <pre class="bg-gray-800 text-gray-100 p-4 rounded overflow-x-auto"><code>// 线程安全的使用示例
Hashtable&lt;String, Integer&gt; table = new Hashtable<>();
// 多线程可以安全调用
table.put("key1", 1);
table.get("key1");</code></pre>
                    </div>
                </section>

                <!-- Synchronization Mechanism -->
                <section class="mb-12">
                    <h2 class="text-2xl font-bold mb-6 flex items-center serif">
                        <span class="w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center mr-4">2</span>
                        <span>同步机制</span>
                    </h2>
                    <div class="grid md:grid-cols-2 gap-6 mb-6">
                        <div class="card-hover bg-white p-6 rounded-lg shadow">
                            <div class="flex items-center mb-4">
                                <i class="fas fa-lock text-indigo-600 mr-2"></i>
                                <h3 class="font-bold">同步</h3>
                            </div>
                            <p class="text-gray-700">Hashtable 使用同步机制来保证线程安全。所有的方法都是同步的，即使是读操作也会加锁，这可能会导致性能下降，特别是在多线程环境中频繁访问时。</p>
                        </div>
                        <div class="card-hover bg-white p-6 rounded-lg shadow">
                            <div class="flex items-center mb-4">
                                <i class="fas fa-unlock-alt text-indigo-600 mr-2"></i>
                                <h3 class="font-bold">锁粒度</h3>
                            </div>
                            <p class="text-gray-700">由于 Hashtable 锁住整个表，这意味着在一个线程访问 Hashtable 时，其他线程无论是读还是写操作都需要等待，这可能会造成性能问题。</p>
                        </div>
                    </div>
                </section>

                <!-- Null Restrictions -->
                <section class="mb-12">
                    <h2 class="text-2xl font-bold mb-6 flex items-center serif">
                        <span class="w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center mr-4">3</span>
                        <span>不允许 null 键和值</span>
                    </h2>
                    <p class="text-lg leading-relaxed mb-4">与 HashMap 不同，Hashtable 不允许键或值为 null。如果尝试插入 null 键或值，Hashtable 会抛出 NullPointerException。</p>
                    <p class="text-lg leading-relaxed mb-6">这是因为 Hashtable 的实现依赖于键和值的哈希值和 equals() 方法，而 null 不符合这种依赖。</p>
                    
                    <div class="bg-red-50 border-l-4 border-red-500 p-4 mb-6">
                        <div class="flex">
                            <div class="flex-shrink-0">
                                <i class="fas fa-exclamation-circle text-red-500"></i>
                            </div>
                            <div class="ml-3">
                                <h3 class="text-sm font-medium text-red-800">注意</h3>
                                <div class="mt-2 text-sm text-red-700">
                                    <p>以下代码会抛出 NullPointerException：</p>
                                    <p class="font-mono mt-1">Hashtable&lt;String, String&gt; table = new Hashtable<>();</p>
                                    <p class="font-mono">table.put(null, "value"); // 抛出异常</p>
                                    <p class="font-mono">table.put("key", null); // 抛出异常</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>

                <!-- Capacity and Load Factor -->
                <section class="mb-12">
                    <h2 class="text-2xl font-bold mb-6 flex items-center serif">
                        <span class="w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center mr-4">4</span>
                        <span>初始容量和负载因子</span>
                    </h2>
                    <p class="text-lg leading-relaxed mb-6">Hashtable 和 HashMap 类似，也具有初始容量和负载因子两个重要属性：</p>
                    
                    <div class="grid md:grid-cols-2 gap-6 mb-6">
                        <div class="card-hover bg-white p-6 rounded-lg shadow">
                            <div class="flex items-center mb-4">
                                <i class="fas fa-expand-arrows-alt text-indigo-600 mr-2"></i>
                                <h3 class="font-bold">初始容量</h3>
                            </div>
                            <p class="text-gray-700 mb-2">Hashtable 的默认初始容量为 <span class="font-bold text-indigo-600">11</span>。当 Hashtable 的键值对数量超过负载因子与当前容量的乘积时，它会自动扩容。</p>
                            <div class="bg-gray-100 p-3 rounded text-sm">
                                <p class="font-mono">// 默认初始容量11</p>
                                <p class="font-mono">Hashtable&lt;String, Integer&gt; table = new Hashtable<>();</p>
                            </div>
                        </div>
                        <div class="card-hover bg-white p-6 rounded-lg shadow">
                            <div class="flex items-center mb-4">
                                <i class="fas fa-balance-scale text-indigo-600 mr-2"></i>
                                <h3 class="font-bold">负载因子</h3>
                            </div>
                            <p class="text-gray-700 mb-2">默认的负载因子为 <span class="font-bold text-indigo-600">0.75</span>，这意味着当 Hashtable 中的元素数量达到 75% 的当前容量时，会触发扩容操作。负载因子的选择在性能和内存使用之间进行权衡。</p>
                            <div class="bg-gray-100 p-3 rounded text-sm">
                                <p class="font-mono">// 指定初始容量和负载因子</p>
                                <p class="font-mono">Hashtable&lt;String, Integer&gt; table = </p>
                                <p class="font-mono">    new Hashtable<>(16, 0.75f);</p>
                            </div>
                        </div>
                    </div>
                </section>

                <!-- Iterator -->
                <section class="mb-12">
                    <h2 class="text-2xl font-bold mb-6 flex items-center serif">
                        <span class="w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center mr-4">5</span>
                        <span>迭代器</span>
                    </h2>
                    <div class="grid md:grid-cols-2 gap-6 mb-6">
                        <div class="card-hover bg-white p-6 rounded-lg shadow">
                            <div class="flex items-center mb-4">
                                <i class="fas fa-history text-indigo-600 mr-2"></i>
                                <h3 class="font-bold">枚举 (Enumeration)</h3>
                            </div>
                            <p class="text-gray-700">在早期版本的 Java 中，Hashtable 使用 Enumeration 来进行迭代。Enumeration 提供了基本的 hasMoreElements() 和 nextElement() 方法来遍历集合。虽然 Enumeration 仍然有效，但在现代 Java 版本中，它通常被 Iterator 取代。</p>
                            <div class="bg-gray-100 p-3 rounded text-sm mt-4">
                                <p class="font-mono">// 使用Enumeration迭代</p>
                                <p class="font-mono">Enumeration&lt;String&gt; keys = table.keys();</p>
                                <p class="font-mono">while (keys.hasMoreElements()) {</p>
                                <p class="font-mono">    String key = keys.nextElement();</p>
                                <p class="font-mono">    // 处理key</p>
                                <p class="font-mono">}</p>
                            </div>
                        </div>
                        <div class="card-hover bg-white p-6 rounded-lg shadow">
                            <div class="flex items-center mb-4">
                                <i class="fas fa-sync-alt text-indigo-600 mr-2"></i>
                                <h3 class="font-bold">迭代器 (Iterator)</h3>
                            </div>
                            <p class="text-gray-700">从 Java 1.2 版本开始，Hashtable 也实现了 Map 接口，并提供了 Iterator，使其可以与其他集合类更好地集成。与 Enumeration 不同，Iterator 支持 remove() 操作，可以在迭代过程中安全地删除元素。</p>
                            <div class="bg-gray-100 p-3 rounded text-sm mt-4">
                                <p class="font-mono">// 使用Iterator迭代</p>
                                <p class="font-mono">Iterator&lt;Map.Entry&lt;String, Integer&gt;&gt; it = </p>
                                <p class="font-mono">    table.entrySet().iterator();</p>
                                <p class="font-mono">while (it.hasNext()) {</p>
                                <p class="font-mono">    Map.Entry&lt;String, Integer&gt; entry = it.next();</p>
                                <p class="font-mono">    // 处理entry或it.remove()</p>
                                <p class="font-mono">}</p>
                            </div>
                        </div>
                    </div>
                </section>

                <!-- Performance -->
                <section class="mb-12">
                    <h2 class="text-2xl font-bold mb-6 flex items-center serif">
                        <span class="w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center mr-4">6</span>
                        <span>性能</span>
                    </h2>
                    <p class="text-lg leading-relaxed mb-6">由于 Hashtable 的方法都是同步的，它在高并发情况下的性能通常不如 ConcurrentHashMap。如果需要高效的线程安全集合，建议使用 ConcurrentHashMap，而不是 Hashtable。</p>
                    
                    <div class="relative bg-white p-6 rounded-lg shadow-lg mb-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-tachometer-alt text-indigo-600 mr-2"></i>
                            <h3 class="font-bold">性能比较</h3>
                        </div>
                        <div class="mermaid">
                            %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#e2e8f0', 'primaryBorderColor': '#4f46e5', 'lineColor': '#4f46e5'}}}%%
                            barChart
                                title 并发读写性能比较(ops/ms)
                                x-axis 操作类型
                                y-axis 操作次数
                                bar "Hashtable" : 125
                                bar "ConcurrentHashMap" : 950
                                bar "HashMap" : 1200
                        </div>
                    </div>
                </section>

                <!-- Legacy Class -->
                <section class="mb-12">
                    <h2 class="text-2xl font-bold mb-6 flex items-center serif">
                        <span class="w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center mr-4">7</span>
                        <span>遗留类</span>
                    </h2>
                    <p class="text-lg leading-relaxed mb-4">Hashtable 是一个遗留类（legacy class），这意味着它在 Java 1.2 之前就已经存在，并且在 Java 1.2 引入了 Map 接口后，Hashtable 实现了这个接口。</p>
                    <p class="text-lg leading-relaxed mb-6">但是，HashMap 和 ConcurrentHashMap 是更现代的类，提供了更多功能和更好的性能。</p>
                    
                    <div class="bg-yellow-50 border-l-4 border-yellow-400 p-4">
                        <div class="flex">
                            <div class="flex-shrink-0">
                                <i class="fas fa-exclamation-triangle text-yellow-500"></i>
                            </div>
                            <div class="ml-3">
                                <h3 class="text-sm font-medium text-yellow-800">历史背景</h3>
                                <div class="mt-2 text-sm text-yellow-700">
                                    <p>Hashtable 是 Java 1.0 版本就存在的类，而 Map 接口是在 Java 1.2 中引入的。为了向后兼容，Hashtable 在 1.2 版本中实现了 Map 接口，但它的实现方式与专门为 Map 接口设计的 HashMap 有所不同。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>

                <!-- Recommendations -->
                <section class="mb-12">
                    <h2 class="text-2xl font-bold mb-6 flex items-center serif">
                        <span class="w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center mr-4">8</span>
                        <span>使用建议</span>
                    </h2>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div class="card-hover bg-white p-6 rounded-lg shadow">
                            <div class="flex items-center mb-4">
                                <i class="fas fa-thumbs-down text-red-500 mr-2"></i>
                                <h3 class="font-bold">不推荐用于新的代码</h3>
                            </div>
                            <p class="text-gray-700">在现代 Java 编程中，通常建议使用 <span class="font-bold text-indigo-600">HashMap</span> 或 <span class="font-bold text-indigo-600">ConcurrentHashMap</span> 来替代 Hashtable。HashMap 提供了更高的性能（不进行同步），而 ConcurrentHashMap 提供了线程安全的高效实现。</p>
                        </div>
                        <div class="card-hover bg-white p-6 rounded-lg shadow">
                            <div class="flex items-center mb-4">
                                <i class="fas fa-code-branch text-blue-500 mr-2"></i>
                                <h3 class="font-bold">现有代码</h3>
                            </div>
                            <p class="text-gray-700">对于维护旧代码的情况，Hashtable 仍然可用，但要注意其线程安全的特性可能带来的性能问题。在可能的情况下，考虑逐步重构为 ConcurrentHashMap。</p>
                        </div>
                    </div>
                </section>

                <!-- Comparison Table -->
                <section class="mb-12">
                    <div class="bg-white shadow rounded-lg overflow-hidden">
                        <table class="min-w-full divide-y divide-gray-200">
                            <thead class="bg-gray-50">
                                <tr>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">特性</th>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Hashtable</th>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">HashMap</th>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ConcurrentHashMap</th>
                                </tr>
                            </thead>
                            <tbody class="bg-white divide-y divide-gray-200">
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">线程安全</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">否</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">同步机制</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">全表锁</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">无</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">分段锁/乐观锁</td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">允许null键值</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">否</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">否</td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">性能</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">低</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">高</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">高</td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">推荐使用</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">旧代码维护</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">单线程环境</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">多线程环境</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </section>

                <!-- Decision Flowchart -->
                <section class="mb-12">
                    <div class="bg-white p-6 rounded-lg shadow">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-project-diagram text-indigo-600 mr-2"></i>
                            <h3 class="font-bold">选择正确的Map实现</h3>
                        </div>
                        <div class="mermaid">
                            %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#e2e8f0', 'primaryBorderColor': '#4f46e5', 'lineColor': '#4f46e5'}}}%%
                            flowchart TD
                                A[需要Map实现?] --> B{需要线程安全?}
                                B -->|是| C{高并发性能重要?}
                                B -->|否| D[使用HashMap]
                                C -->|是| E[使用ConcurrentHashMap]
                                C -->|否| F[使用Hashtable]
                                D --> G[结束]
                                E --> G
                                F --> G
                        </div>
                    </div>
                </section>
            </article>

            <!-- Sidebar -->
            <aside class="lg:w-1/3">
                <!-- Author Card -->
                <div class="bg-white rounded-lg shadow p-6 mb-6">
                    <div class="flex items-center mb-4">
                        <div class="w-16 h-16 rounded-full bg-indigo-100 flex items-center justify-center">
                            <i class="fas fa-user text-indigo-600 text-2xl"></i>
                        </div>
                        <div class="ml-4">
                            <h3 class="font-bold">技术小馆</h3>
                            <p class="text-sm text-gray-600">Java 技术专家</p>
                        </div>
                    </div>
                    <p class="text-gray-700 mb-4">专注于Java核心技术、并发编程和性能优化的知识分享。</p>
                    <div class="flex space-x-4 text-gray-500">
                        <a href="#" class="hover:text-indigo-600"><i class="fab fa-github"></i></a>
                        <a href="#" class="hover:text-indigo-600"><i class="fab fa-twitter"></i></a>
                        <a href="#" class="hover:text-indigo-600"><i class="fab fa-linkedin"></i></a>
                    </div>
                </div>

                <!-- Table of Contents -->
                <div class="bg-white rounded-lg shadow p-6 mb-6">
                    <h3 class="font-bold mb-4 flex items-center">
                        <i class="fas fa-list-ul text-indigo-600 mr-2"></i>
                        目录
                    </h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-indigo-600 hover:underline">线程安全</a></li>
                        <li><a href="#" class="text-indigo-600 hover:underline">同步机制</a></li>
                        <li><a href="#" class="text-indigo-600 hover:underline">不允许null键值</a></li>
                        <li><a href="#" class="text-indigo-600 hover:underline">初始容量和负载因子</a></li>
                        <li><a href="#" class="text-indigo-600 hover:underline">迭代器</a></li>
                        <li><a href="#" class="text-indigo-600 hover:underline">性能</a></li>
                        <li><a href="#" class="text-indigo-600 hover:underline">遗留类</a></li>
                        <li><a href="#" class="text-indigo-600 hover:underline">使用建议</a></li>
                    </ul>
                </div>

                <!-- Related Articles -->
                <div class="bg-white rounded-lg shadow p-6">
                    <h3 class="font-bold mb-4 flex items-center">
                        <i class="fas fa-book-reader text-indigo-600 mr-2"></i>
                        相关文章
                    </h3>
                    <div class="space-y-4">
                        <div class="border-b pb-4">
                            <a href="#" class="font-medium hover:text-indigo-600">HashMap 内部实现原理</a>
                            <p class="text-sm text-gray-500 mt-1">深入分析HashMap的哈希算法和扩容机制</p>
                        </div>
                        <div class="border-b pb-4">
                            <a href="#" class="font-medium hover:text-indigo-600">ConcurrentHashMap 并发实现</a>
                            <p class="text-sm text-gray-500 mt-1">解析Java8中ConcurrentHashMap的优化</p>
                        </div>
                        <div>
                            <a href="#" class="font-medium hover:text-indigo-600">Java集合框架演进史</a>
                            <p class="text-sm text-gray-500 mt-1">从Hashtable到现代并发集合的发展历程</p>
                        </div>
                    </div>
                </div>
            </aside>
        </div>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8">
        <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="md:flex md:items-center md:justify-between">
                <div class="flex justify-center md:order-2 space-x-6">
                    <a href="#" class="hover:text-white">
                        <i class="fab fa-github"></i>
                    </a>
                    <a href="#" class="hover:text-white">
                        <i class="fab fa-twitter"></i>
                    </a>
                </div>
                <div class="mt-8 md:mt-0 md:order-1">
                    <p class="text-center md:text-left">技术小馆</p>
                    <p class="text-center md:text-left text-sm mt-1">
                        <a href="http://www.yuque.com/jtostring" class="hover:text-white underline">http://www.yuque.com/jtostring</a>
                    </p>
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: { useMaxWidth: false, htmlLabels: true },
        });
    </script>
</body>
</html>
```